import { IconLink, IconImage, IconCheckSquare, IconOrderedList, IconUnorderedList, IconMinus, IconFileVideo, IconFilePdf, IconBranch, IconEye, IconUpload, IconDownload, IconLineHeight, IconQuote, IconFileAudio, IconCodeBlock } from "@arco-design/web-vue/es/icon"

// 定义 ToolItemType 类型
export type ToolItemType = {
	type: string
	icon: any // 你可以根据实际使用的图标库类型进行调整
	text: string
	html: string
	iconCol: string
}

// 默认的 toolbar 配置
const toolbar = {
	editorToolbarlist: [
		{
			type: "base",
			data: [
				{
					type: "H",
					icon: "H",
					text: "标题",
					html: "",
					iconCol: "",
					options: ["H1", "H2", "H3", "H4", "H5"],
				},
				{
					type: "F",
					icon: "",
					text: "字体样式",
					html: '<span style="font-size:1.05em;vertical-align:-5px;"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="currentColor" d="M15 4h7v2h-7zm1 4h6v2h-6zm2 4h4v2h-4zM9.307 4l-6 16h2.137l1.875-5h6.363l1.875 5h2.137l-6-16zm-1.239 9L10.5 6.515L12.932 13z"/></svg></span>',
					options: ["Arial", "Helvetica", "serif", "Times New Roman", "Courier New", "Verdana", "Georgia", "Trebuchet MS", "Impact", "Comic Sans MS"],
					iconCol: "",
				},
				{
					type: "LineHeight",
					icon: IconLineHeight,
					text: "字体行高",
					html: "",
					options: [1, 1.15, 1.3, 1.5, 2, 3],
					iconCol: "",
				},
				{
					type: "AiWrite",
					icon: "",
					text: "AI创作",
					html: '<span style="font-size:1.2em;vertical-align:-9px;"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><g fill="none" stroke="#fc9157" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><path d="M5.5 16c5 2.5 8 2.5 13 0"/><path d="m15.5 17.5l1 2s4.171-1.328 5.5-3.5c0-1 .53-8.147-3-10.5c-1.5-1-4-1.5-4-1.5l-1 2h-2"/><path d="m8.528 17.5l-1 2s-4.171-1.328-5.5-3.5c0-1-.53-8.147 3-10.5c1.5-1 4-1.5 4-1.5l1 2h2"/><path d="M8.5 14c-.828 0-1.5-.895-1.5-2s.672-2 1.5-2s1.5.895 1.5 2s-.672 2-1.5 2m7 0c-.828 0-1.5-.895-1.5-2s.672-2 1.5-2s1.5.895 1.5 2s-.672 2-1.5 2"/></g></svg></span>',
					iconCol: "orange",
				},
				{
					type: "Link",
					icon: IconLink,
					text: "链接",
					html: "",
					iconCol: "",
				},
				{
					type: "Image",
					icon: IconImage,
					text: "图片",
					html: "",
				},
				{
					type: "Quote",
					icon: IconQuote,
					text: "引用",
					html: "",
					iconCol: "",
				},
				{
					type: "Table",
					icon: "",
					text: "表格",
					html: '<span style="font-size:1em;vertical-align:-4px;"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 20 20"><path fill="currentColor" d="M1.364 5.138v12.02h17.272V5.138zM.909 1.5h18.182c.502 0 .909.4.909.895v15.21a.9.9 0 0 1-.91.895H.91c-.503 0-.91-.4-.91-.895V2.395C0 1.9.407 1.5.91 1.5m5.227 1.759c0-.37.306-.671.682-.671s.682.3.682.671v13.899c0 .37-.305.67-.682.67a.676.676 0 0 1-.682-.67zm6.96-.64c.377 0 .682.3.682.67v4.995h4.91c.377 0 .683.301.683.672c0 .37-.306.671-.682.671l-4.911-.001v3.062h5.002c.377 0 .682.3.682.671c0 .37-.305.671-.682.671h-5.002v3.158a.676.676 0 0 1-.682.671a.676.676 0 0 1-.681-.67l-.001-3.159H1.001a.676.676 0 0 1-.682-.67c0-.371.305-.672.682-.672h11.413V9.626L.909 9.627a.676.676 0 0 1-.682-.671c0-.37.306-.671.682-.671l11.505-.001V3.289c0-.37.306-.67.682-.67"/></svg></span>',
					iconCol: "",
				},
				{
					type: "Checkbox",
					icon: IconCheckSquare,
					text: "任务清单",
					html: "",
					iconCol: "",
				},
				{
					type: "OrderList",
					icon: IconOrderedList,
					text: "有序列表",
					html: "",
					iconCol: "",
				},
				{
					type: "UnorderList",
					icon: IconUnorderedList,
					text: "无序列表",
					html: "",
					iconCol: "",
				},
				{
					type: "CodeBox",
					icon: "",
					text: "代码块",
					html: '<span style="font-size:1.05em;vertical-align:-6px;"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 14 14"><path fill="currentColor" fill-rule="evenodd" d="M10.476 2.893a1 1 0 1 0-1.46 1.367L11.578 7L9.015 9.74a1 1 0 1 0 1.46 1.367l3.204-3.424a1 1 0 0 0 0-1.366zM4.985 4.26a1 1 0 1 0-1.46-1.367L.32 6.317a1 1 0 0 0 0 1.366l3.203 3.424a1 1 0 0 0 1.46-1.367L2.422 7l2.564-2.74Z" clip-rule="evenodd"/></svg></span>',
					iconCol: "",
				},
				{
					type: "Divider",
					icon: IconMinus,
					text: "水平线",
					html: "",
					iconCol: "",
				},
				{
					type: "Alert",
					icon: "",
					text: "警告提示",
					html: '<span style="font-size:1.05em;vertical-align:-4px;"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 1024 1024"><path fill="currentColor" d="M193 796c0 17.7 14.3 32 32 32h574c17.7 0 32-14.3 32-32V563c0-176.2-142.8-319-319-319S193 386.8 193 563zm72-233c0-136.4 110.6-247 247-247s247 110.6 247 247v193H404V585c0-5.5-4.5-10-10-10h-44c-5.5 0-10 4.5-10 10v171h-75zm-48.1-252.5l39.6-39.6c3.1-3.1 3.1-8.2 0-11.3l-67.9-67.9a8.03 8.03 0 0 0-11.3 0l-39.6 39.6a8.03 8.03 0 0 0 0 11.3l67.9 67.9c3.1 3.1 8.1 3.1 11.3 0m669.6-79.2l-39.6-39.6a8.03 8.03 0 0 0-11.3 0l-67.9 67.9a8.03 8.03 0 0 0 0 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l67.9-67.9c3.1-3.2 3.1-8.2 0-11.3M832 892H192c-17.7 0-32 14.3-32 32v24c0 4.4 3.6 8 8 8h688c4.4 0 8-3.6 8-8v-24c0-17.7-14.3-32-32-32M484 180h56c4.4 0 8-3.6 8-8V76c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v96c0 4.4 3.6 8 8 8"/></svg></span>',
					iconCol: "",
				},
				// 表情
				{
					type: "Emoji",
					icon: "",
					text: "表情",
					html: '<span style="font-size:1.05em;vertical-align:-6px;"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="-2 -2 24 24"><path fill="currentColor" d="M10 20C4.477 20 0 15.523 0 10S4.477 0 10 0s10 4.477 10 10s-4.477 10-10 10m0-2a8 8 0 1 0 0-16a8 8 0 0 0 0 16m-3.92-4.606a1 1 0 1 1 1.84-.788a2.264 2.264 0 0 0 4.16 0a1 1 0 1 1 1.84.788a4.264 4.264 0 0 1-7.84 0M7 6a1 1 0 0 1 1 1v2a1 1 0 1 1-2 0V7a1 1 0 0 1 1-1m6 0a1 1 0 0 1 1 1v2a1 1 0 0 1-2 0V7a1 1 0 0 1 1-1"/></svg></span>',
					options: [
						"😃",
						"😄",
						"😅",
						"😊",
						"😇",
						"🙂",
						"🙃",
						"😉",
						"😌",
						"🥰",
						"😘",
						"😗",
						"😙",
						"😚",
						"😋",
						"😛",
						"😝",
						"😜",
						"🤪",
						"🤨",
						"🧐",
						"🤓",
						"😏",
						"😒",
						"😞",
						"😔",
						"😟",
						"😕",
						"🙁",
						"☹️",
						"😣",
						"😖",
						"😫",
						"😩",
						"🥺",
						"😢",
						"😭",
						"😤",
						"😠",
						"😡",
						"🤬",
						"🤯",
						"😳",
						"🥵",
						"🥶",
						"😱",
						"😨",
						"😰",
						"😥",
						"😓",
						"🤗",
						"🤔",
						"🤭",
						"🤫",
						"🤥",
						"😶",
						"😐",
						"😑",
						"😬",
						"🙄",
						"😯",
						"😦",
						"😧",
						"😮",
						"😲",
						"🥱",
						"😴",
						"🤤",
						"😪",
						"😵",
						"🤐",
						"🥴",
						"🤢",
						"🤮",
						"🤧",
						"😷",
						"🤒",
						"🤕",
						"🤑",
						"🤠",
						"😈",
						"👿",
						"👹",
						"👺",
						"💀",
						"☠️",
						"👻",
						"💩",
						"🤡",
						"🎃",
						"👽",
						"👾",
						"🤖",
						"🎯",
						"💫",
						"✨",
						"🌟",
						"⭐",
						"🌠",
						"🔥",
						"💥",
						"💦",
						"🌊",
						"🍀",
						"🍃",
						"🍂",
						"🍁",
						"🌻",
						"🌹",
						"🥀",
						"🌷",
						"🌸",
						"🌲",
						"🌳",
						"🌴",
						"🌵",
						"🌾",
						"🌿",
						"🍄",
						"🐔",
						"🐤",
						"🐣",
						"🐥",
						"🏃",
						"💃",
						"🕺",
						"👯",
						"👫",
						"🙌",
						"👏",
						"🙏",
						"🤝",
						"👍",
						"👎",
						"✊",
						"👊",
						"🤛",
						"🤜",
						"👌",
						"🤞",
						"🤟",
						"🤘",
						"👈",
						"👉",
						"👆",
						"👇",
						"☝️",
						"🖐️",
						"🖖",
						"👋",
						"🤚",
						"💪",
						"🦾",
						"🦵",
						"🦶",
						"👂",
						"👃",
						"👁️",
						"👀",
						"🤳",
						"💅",
						"👒",
						"👑",
						"👓",
						"👘",
						"👚",
						"👕",
						"🧥",
						"🎽",
						"🩱",
						"👖",
						"🩳",
						"👗",
						"🧣",
						"🧤",
						"🧢",
						"👟",
						"👠",
						"👡",
						"👢",
						"👞",
						"🥾",
						"🥿",
						"🛌",
						"🛏️",
						"🪑",
						"💺",
						"🛋️",
						"🖼️",
						"🪞",
						"⏱️",
						"⌚",
						"📱",
						"📲",
						"💻",
						"🖥️",
						"🖨️",
						"🖱️",
						"🖲️",
						"🗜️",
						"📏",
						"📐",
						"🧰",
						"🔧",
						"🔨",
						"🪓",
						"⛏️",
						"🪚",
						"🗡️",
						"⚔️",
						"🛡️",
						"🔫",
						"💣",
						"🧨",
						"🎆",
						"🎇",
						"🎉",
						"🎊",
						"🥳",
						"🎈",
						"🎁",
						"🎗️",
						"🏮",
						"🛒",
						"💰",
						"💵",
						"💶",
						"💷",
						"💸",
						"💳",
						"📄",
						"📃",
						"📋",
						"📆",
						"🗓️",
						"🕰️",
						"⌛",
						"⏰",
						"📚",
						"📓",
						"📔",
						"📕",
						"📖",
						"📗",
						"📘",
						"📙",
						"📒",
						"🗂️",
						"📂",
						"🗃️",
						"🗄️",
						"🗑️",
						"🛅",
						"🧳",
						"🎒",
						"👜",
						"👝",
						"👛",
						"💼",
						"🩴",
						"🥅",
						"🏀",
						"🏈",
						"⚽",
						"⚾",
						"🥎",
						"🎾",
						"🏐",
						"🏉",
						"🥏",
						"🎱",
						"🪀",
						"🏓",
						"🌤️",
						"⛅",
						"🌥️",
						"🌧️",
						"🌨️",
						"⛄",
						"🌬️",
						"💨",
						"🌪️",
						"🌇",
						"🌉",
						"🌁",
						"🗼",
						"🗾",
						"🏝️",
						"🏖️",
						"🪸",
						"🐚",
						"🍎",
						"🍏",
						"🍐",
						"🍊",
						"🍋",
						"🍌",
						"🍉",
						"🍇",
						"🍓",
						"🫐",
						"🍈",
						"🍒",
						"🍑",
						"🥭",
						"🍍",
						"🥥",
						"🥝",
						"🍅",
						"🥑",
						"🍆",
						"🥔",
						"🥕",
						"🌶️",
						"🫑",
						"🥒",
						"🍄",
						"🧄",
						"🧅",
						"🥬",
						"🥦",
						"🧃",
						"🥤",
						"🍵",
						"🍶",
						"🍷",
						"🍸",
						"🍹",
						"🍻",
						"🥂",
						"🥃",
						"☕",
						"🫖",
						"🍽️",
						"🍴",
						"🥄",
						"🍳",
						"🍲",
						"🥘",
						"🍜",
						"🍝",
						"🍠",
						"🍢",
						"🍡",
						"🍤",
						"🍣",
						"🥟",
						"🦪",
						"🍘",
						"🥫",
						"🍱",
						"🍣",
						"🥟",
						"🍘",
						"🍙",
						"🥗",
						"🥫",
					],
				},
			],
		},
		{
			type: "media",
			data: [
				{
					type: "Math",
					icon: IconCodeBlock,
					text: "函数公式",
					html: "",
					iconCol: "",
				},
				{
					type: "Audio",
					icon: IconFileAudio,
					text: "音频",
					html: "",
					iconCol: "",
				},
				{
					type: "Video",
					icon: IconFileVideo,
					text: "视频",
					html: "",
					iconCol: "",
				},
				{
					type: "PDFParser",
					text: "PDF嵌入",
					icon: IconFilePdf,
					html: "",
					iconCol: "red",
				},
				{
					type: "PDFTextParser",
					text: "PDF文本解析",
					icon: "",
					html: '<span style="color:red;font-size:.95em;vertical-align:-5px;"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 15 15"><path fill="currentColor" d="M2.5 6.5V6H2v.5zm4 0V6H6v.5zm0 4H6v.5h.5zm7-7h.5v-.207l-.146-.147zm-3-3l.354-.354L10.707 0H10.5zM2.5 7h1V6h-1zm.5 4V8.5H2V11zm0-2.5v-2H2v2zm.5-.5h-1v1h1zm.5-.5a.5.5 0 0 1-.5.5v1A1.5 1.5 0 0 0 5 7.5zM3.5 7a.5.5 0 0 1 .5.5h1A1.5 1.5 0 0 0 3.5 6zM6 6.5v4h1v-4zm.5 4.5h1v-1h-1zM9 9.5v-2H8v2zM7.5 6h-1v1h1zM9 7.5A1.5 1.5 0 0 0 7.5 6v1a.5.5 0 0 1 .5.5zM7.5 11A1.5 1.5 0 0 0 9 9.5H8a.5.5 0 0 1-.5.5zM10 6v5h1V6zm.5 1H13V6h-2.5zm0 2H12V8h-1.5zM2 5V1.5H1V5zm11-1.5V5h1V3.5zM2.5 1h8V0h-8zm7.646-.146l3 3l.708-.708l-3-3zM2 1.5a.5.5 0 0 1 .5-.5V0A1.5 1.5 0 0 0 1 1.5zM1 12v1.5h1V12zm1.5 3h10v-1h-10zM14 13.5V12h-1v1.5zM12.5 15a1.5 1.5 0 0 0 1.5-1.5h-1a.5.5 0 0 1-.5.5zM1 13.5A1.5 1.5 0 0 0 2.5 15v-1a.5.5 0 0 1-.5-.5z"/></svg></span>',
					iconCol: "",
				},
				{
					type: "DocParser",
					text: "Word解析",
					icon: "",
					html: '<span style="color:rgb(0, 102, 204);font-size:1.1em;vertical-align:-7px;"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 1024 1024"><path fill="currentColor" d="M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7M790.2 326H602V137.8zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216zM528.1 472h-32.2c-5.5 0-10.3 3.7-11.6 9.1L434.6 680l-46.1-198.7c-1.3-5.4-6.1-9.3-11.7-9.3h-35.4a12.02 12.02 0 0 0-11.6 15.1l74.2 276c1.4 5.2 6.2 8.9 11.6 8.9h32c5.4 0 10.2-3.6 11.6-8.9l52.8-197l52.8 197c1.4 5.2 6.2 8.9 11.6 8.9h31.8c5.4 0 10.2-3.6 11.6-8.9l74.4-276a12.04 12.04 0 0 0-11.6-15.1H647c-5.6 0-10.4 3.9-11.7 9.3l-45.8 199.1l-49.8-199.3c-1.3-5.4-6.1-9.1-11.6-9.1"/></svg></span>',
					iconCol: "#06c",
				},
				{
					type: "Iframe",
					icon: "",
					text: "内嵌网页",
					html: '<span style="font-size:1em;vertical-align:-4px;"><svg  width="1em" height="1em" viewBox="0 0 1024 1024"><path fill="currentColor" d="M852.6 367.6c16.3-36.9 32.1-90.7 32.1-131.8c0-109.1-119.5-147.6-314.5-57.9c-161.4-10.8-316.8 110.5-355.6 279.7c46.3-52.3 117.4-123.4 183-151.7C316.1 378.3 246.7 470 194 565.6c-31.1 56.9-66 148.8-66 217.5c0 147.9 139.3 129.8 270.4 63c47.1 23.1 99.8 23.4 152.5 23.4c145.7 0 276.4-81.4 325.2-219H694.9c-78.8 132.9-295.2 79.5-295.2-71.2h493.2c9.6-65.4-2.5-143.6-40.3-211.7M224.8 648.3c26.6 76.7 80.6 143.8 150.4 185c-133.1 73.4-259.9 43.6-150.4-185m174-163.3c3-82.7 75.4-142.3 156-142.3c80.1 0 153 59.6 156 142.3zm276.8-281.4c32.1-15.4 72.8-33 108.8-33c47.1 0 81.4 32.6 81.4 80.6c0 30-11.1 73.5-21.9 101.8c-39.3-63.5-98.9-122.4-168.3-149.4"/></svg></span>',
					iconCol: "",
				},
				{
					type: "MindChart",
					icon: IconBranch,
					text: "思维导图",
					html: "",
					iconCol: "",
				},
			],
		},
		{
			type: "operate",
			data: [
				{
					type: "Water",
					icon: "",
					text: "水印",
					html: '<span style="font-size:1em;vertical-align:-4px;"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 1024 1024"><path fill="currentColor" d="M145.713 752c1.994 0 3.988-.2 5.982-.498l168.19-29.508c1.994-.399 3.888-1.296 5.284-2.792l423.915-423.875a9.927 9.927 0 0 0 0-14.056l-166.196-166.38c-1.894-1.894-4.388-2.891-7.079-2.891s-5.184.997-7.078 2.891L144.816 538.766c-1.495 1.496-2.393 3.29-2.791 5.284l-29.511 168.174c-1.894 11.066 1.495 21.932 9.372 29.807c6.58 6.48 14.954 9.969 23.827 9.969m51.743-85.433l15.653-88.922l362.7-362.667l73.278 73.271l-362.7 362.667zm401.37-98.639c27.691-14.812 57.293-20.852 85.545-15.519c32.365 6.11 59.72 26.534 78.96 59.406c29.974 51.211 21.642 102.332-18.484 144.254c-17.577 18.364-41.07 35.013-69.996 50.297l-.293.152l.848.26c13.153 3.956 27.085 6.1 41.54 6.21l1.174.005c61.068 0 100.981-22.104 125.285-67.876c9.325-17.56 31.119-24.237 48.679-14.913c17.56 9.325 24.237 31.119 14.912 48.68c-37.285 70.218-102.092 106.109-188.876 106.109c-47.687 0-91.94-15.03-128.188-41.368l-1.056-.774l-1.36.473c-46.18 15.996-98.732 29.945-155.37 41.932l-2.239.472c-48.571 10.217-97.257 18.377-139.154 23.957c-19.709 2.625-37.813-11.224-40.438-30.932c-2.625-19.709 11.224-37.813 30.932-40.438c40.196-5.353 87.126-13.22 133.84-23.045c42.799-9.002 83.011-19.134 119.357-30.342l.234-.074l-.436-.693c-16.464-26.452-25.857-55.432-26.142-83.24l-.007-1.303c0-49.907 39.555-104.315 90.733-131.69m72.188 55.231c-10.74-2.027-24.099.699-38.228 8.257c-29.546 15.804-52.693 47.643-52.693 68.202c0 18.206 8.889 40.146 24.71 59.736l.238.293l1.223-.514c39.17-16.581 68.483-34.271 85.929-52.186l.64-.663c18.735-19.573 21.386-35.842 8.36-58.1c-9.059-15.475-19.03-22.92-30.18-25.025"/></svg></span>',
					iconCol: "",
				},
				{
					type: "Readonly",
					icon: IconEye,
					text: "阅读/编辑模式切换",
					html: "",
					iconCol: "",
				},
				{
					type: "Clear",
					icon: "",
					text: "清空",
					html: '<span style="font-size:1em;vertical-align:-4px;"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 1024 1024"><path fill="currentColor" d="m899.1 869.6l-53-305.6H864c14.4 0 26-11.6 26-26V346c0-14.4-11.6-26-26-26H618V138c0-14.4-11.6-26-26-26H432c-14.4 0-26 11.6-26 26v182H160c-14.4 0-26 11.6-26 26v192c0 14.4 11.6 26 26 26h17.9l-53 305.6c-.3 1.5-.4 3-.4 4.4c0 14.4 11.6 26 26 26h723c1.5 0 3-.1 4.4-.4c14.2-2.4 23.7-15.9 21.2-30M204 390h272V182h72v208h272v104H204zm468 440V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H416V674c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v156H202.8l45.1-260H776l45.1 260z"/></svg></span>',
					iconCol: "",
				},
				{
					type: "UploadJson",
					icon: IconUpload,
					text: "上传文件(支持json和markdown格式)",
					html: "",
					iconCol: "",
				},
				{
					type: "Download",
					icon: IconDownload,
					text: "下载",
					html: "",
					iconCol: "",
				},
			],
		},
	],
}

export default toolbar

